package com.yanjingzheng.entity;

/**
 * @Author Yenchingcheng
 * @Date 2023/9/11 11:25
 * @Description 红色装饰器--具体装饰器，实现了抽象装饰器的接口，负责向抽象组件添加新的功能。具体装饰器通常会在调用原始对象的方法之前或之后执行自己的操作。
 **/
public class RedShapeDecorator extends ShapeDecorator{
    public RedShapeDecorator(Shape decoratedShape) {
        super(decoratedShape);
    }

    @Override
    public void draw() {
        decoratedShape.draw();
        this.setColorBorder(decoratedShape);
    }

    private void setColorBorder(Shape decoratedShape){
        System.out.println("Border Color: Red");
    }
}
